# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models

# Create your models here.


class CrontabsInfo(models.Model):
    IpAddress = models.CharField(blank=False, max_length=16, verbose_name="IP地址")
    HostName = models.CharField(blank=True, max_length=32, verbose_name="主机名")
    IsActive = models.BooleanField(blank=False, verbose_name="是否生效")
    Crontabs_id = models.IntegerField(blank=False, verbose_name="任务Id")
    User = models.CharField(blank=False, max_length=12, verbose_name="用户名")
    Minute = models.CharField(blank=False, max_length=8, verbose_name="分")
    Hour = models.CharField(blank=False, max_length=8, verbose_name="时")
    Day = models.CharField(blank=False, max_length=8, verbose_name="日")
    Month = models.CharField(blank=False, max_length=8, verbose_name="月")
    Week = models.CharField(blank=False, max_length=8, verbose_name="周")
    Command = models.TextField(blank=False, max_length=12800, verbose_name="执行命令")
    UpdateTime = models.CharField(blank=False, max_length=20, verbose_name="更新时间")
    # AdminUsers = models.CharField(blank=False, max_length=128, verbose_name="管理帐号")
    Status = models.IntegerField(verbose_name="主机状态")

    def __unicode__(self):
        return self.IpAddress

